<?php
/*
 * 进云智能生成平台
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
 */
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
$merchid=$_RQ['merchid']?:$_SESSION['onemerchid'];
if($_RQ['op']=='get'){
    $return['merch']=pdo_get('jy_merch_user',array('id'=>$merchid,'uniacid'=>$_SESSION['uniacid']));
	$return['title']='注册';
    $member=model('core/member')->member_show($_SESSION['uid']);
	$item=array('name'=> $member['realname'],'mobile'=> $member['mobile']);
	$return['setting']=$setting;
    $return['xieyi']=$this->plugin_setting('fansxieyi');
    $item['fromuser']=$_SESSION['fromuser'];
	$return['item']=$item;
	exi($return);
}
if($_RQ['op']=='post'){
	$post=get_postdata();
    if(!$post['check']){
        exi('请先阅读会员协议！','error');
    }
	if(!$post['name'] || !$post['mobile']){
		exi('请输入会员姓名和手机号！','error');
	}
	$update=array(
        'name'=>$post['name'],
        'mobile'=>$post['mobile'],
        'fromuser'=>$post['fromcode'],
    );
    pdo_update('jy_merch_member',$update,array('mid'=>$_SESSION['uid'],'merchid'=>$merchid,'uniacid'=>$_SESSION['uniacid']));
	exi('提交成功！','',$_SESSION['forward_url']?:'jy_merch/myshop//id='.$merchid);
}
?>